{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>BLOG</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <link rel="icon" type="image/png" href="{% static 'assets/i/favicon.png' %}">
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="msapplication-TileImage" content="{% static 'assets/i/app-icon72x72@2x.png' %}">
  <meta name="msapplication-TileColor" content="#0e90d2">
  <link rel="stylesheet" href="{% static 'assets/css/amazeui.min.css' %}">
  <link rel="stylesheet" href="{% static 'assets/css/app.css' %}">
</head>

<body id="blog">

<header class="am-g am-g-fixed blog-fixed blog-text-center blog-header">
    <div class="am-u-sm-8 am-u-sm-centered">
        <img width="200" src="{% static 'images/pythonstudy.png' %}" />
        <h2 class="am-hide-sm-only">Python学习社区，支持移动设备</h2>
    </div>
</header>
<hr>
<nav class="am-g am-g-fixed blog-fixed blog-nav">
<button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only blog-button" data-am-collapse="{target: '#blog-collapse'}" ><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

  <div class="am-collapse am-topbar-collapse" id="blog-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav">
      <li class="am-active"><a href="/">首页</a></li>
      <li class="am-dropdown" data-am-dropdown>
        <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
          话题 <span class="am-icon-caret-down"></span>
        </a>
        <ul class="am-dropdown-content">
         {% for t in topics %}
          <li><a href="/topic/{{ t.id }}">{{ t.tname }}</a></li>
         {% endfor %}
        </ul>
      </li>
      {% if request.session.s_name_001 %}
      <li><a href="/post">写文章</a></li>
      <li><a href="/logout">注销</a></li>
      {% else %}
      <li><a href="/login">登录</a></li>
      <li><a href="/register">注册</a></li>
      {% endif %}
      <li><a href="/archive">文章归档</a></li>
    </ul>
    <form class="am-topbar-form am-topbar-right am-form-inline" role="search">
      {% csrf_token %}
      <div class="am-form-group">
          {% if request.session.s_name_001 %}{{ request.session.s_name_001 }},您好！{% endif %}
        <input type="text" class="am-form-field am-input-sm" placeholder="搜索">
      </div>
    </form>
  </div>
</nav>
<hr>

<!-- content srart -->
<div class="am-g am-g-fixed blog-fixed">
    <div class="am-u-md-8 am-u-sm-12">
    {% for item in articles %}
        <article class="am-g blog-entry-article">
            <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-img">
                <img src="static/userimg/{{ item.image }}" alt="" class="am-u-sm-12">
            </div>
            <div class="am-u-lg-6 am-u-md-12 am-u-sm-12 blog-entry-text">
                <span class="blog-color">作者: </span>
                <span> {% for i in item.author.all %}{{ i.nickname }} {% endfor %}&nbsp;</span>
                <span>{{ item.publish_date }}</span>
                <h1><a href="/article/{{ item.id }}">{{ item.title }}</a></h1>
                <p>{{ item.brief }}</p>
                <p><a href="" class="blog-continue">continue reading</a></p>
            </div>
        </article>
    {% endfor %}
        <ul class="am-pagination">
        {% if articles.has_previous %}
        <li class="am-pagination-prev"><a href="?page={{ articles.previous_page_number }}">&laquo; Prev</a></li>
        {% else %}
        <li class="am-pagination-prev"></li>
        {% endif %}
        {% if articles.has_next %}
        <li class="am-pagination-next"><a href="?page={{ articles.next_page_number }}">Next &raquo;</a></li>
        {% else %}
        <li class="am-pagination-next"></li>
        {% endif %}
</ul>
    </div>
    <div class="am-u-md-4 am-u-sm-12 blog-sidebar">
        <div class="blog-sidebar-widget blog-bor">
            <h2 class="blog-text-center blog-title"><span>网站介绍</span></h2>
            <img src="{% static 'images/about.gif' %}" class="blog-entry-img" >
            <p>Hello</p>
            <p>这个页面用的是开源 HTML5 跨屏前端框架。</p>
            <p>PythonWeb最后一次作业，功能包括：文章浏览、文章发布、热门文章、评论、伪静态化、用户登录、用户注册、分页、图片上传(目前只支持上传一张图片)。搜索功能还未开发。
            富文本框用的是tinymce,未实现富文本框的文件上传。</p>
        </div>
        <div class="blog-sidebar-widget blog-bor">
            <h2 class="blog-text-center blog-title"><span>Contact ME</span></h2>
            <p>
                <a href=""><span class="am-icon-qq am-icon-fw am-primary blog-icon"></span></a>
                <a href=""><span class="am-icon-github am-icon-fw blog-icon"></span></a>
                <a href=""><span class="am-icon-weibo am-icon-fw blog-icon"></span></a>
                <a href=""><span class="am-icon-reddit am-icon-fw blog-icon"></span></a>
                <a href=""><span class="am-icon-weixin am-icon-fw blog-icon"></span></a>
            </p>
        </div>
        <div class="blog-sidebar-widget blog-bor">
            <h2 class="blog-title"><span>热门文章</span></h2>
            <ul class="am-list">
                {% for h in hot %}
                <li><a href="/article/{{ h.id }}">{{ h.title }}</a></li>
                {% endfor %}
            </ul>
        </div>
    </div>
</div>
<!-- content end -->
 <footer class="blog-footer">
    <div class="am-g am-g-fixed blog-fixed am-u-sm-centered blog-footer-padding">
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
            <h3>网站简介</h3>
            <p class="am-text-sm">这是一个使用amazeUI做的简单的前端模板。<br> 博客/ 资讯类 前端模板 <br> 支持响应式，多种布局，包括主页、文章页、媒体页、分类页等<br>嗯嗯嗯，不知道说啥了。外面的世界真精彩<br><br>
            Amaze UI 使用 MIT 许可证发布，用户可以自由使用、复制、修改、合并、出版发行、散布、再授权及贩售 Amaze UI 及其副本。</p>
        </div>
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
            <h3>社交账号</h3>
            <p>
                <a href=""><span class="am-icon-qq am-icon-fw am-primary blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-github am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-weibo am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-reddit am-icon-fw blog-icon blog-icon"></span></a>
                <a href=""><span class="am-icon-weixin am-icon-fw blog-icon blog-icon"></span></a>
            </p>
            <h3>Credits</h3>
            <p>我们追求卓越，然时间、经验、能力有限。Amaze UI 有很多不足的地方，希望大家包容、不吝赐教，给我们提意见、建议。感谢你们！</p>
        </div>
        <div class="am-u-sm-12 am-u-md-4- am-u-lg-4">
              <h1>我们站在巨人的肩膀上</h1>
             <h3>技术来源</h3>
            <p>
                <ul>
                    <li>jQuery</li>
                    <li>Zepto.js</li>
                    <li>Seajs</li>
                    <li>LESS</li>
                    <li>...</li>
                </ul>
            </p>
        </div>
    </div>
    <div class="blog-text-center">© 2018 AllMobilize, Inc. 鲁ICP备16036909 蜂山二路</div>
  </footer>


<script src="{% static 'assets/js/jquery.min.js' %}"></script>
<script src="{% static 'assets/js/amazeui.min.js' %}"></script>
</body>
</html>